﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.Client;
using System.IO;
using System.Reflection;

namespace SymbolEditor.WpfLibrary.Helper
{
    public static class ArcServerClientHelper
    {
        public static string STR_GRAPHIC_ATT_SET = "SET";
        public static string STR_GRAPHIC_ATT_XAML = "XAML";
        public static string STR_GRAPHIC_ATT_KEY = "KEY";


        public static Graphic Copy(Graphic g)
        {
            if (g != null)
            {
                Graphic graphicCopy = new Graphic()
                {
                    Symbol = g.Symbol,
                    Geometry = g.Geometry
                };
                foreach (string key in g.Attributes.Keys)
                {
                    graphicCopy.Attributes.Add(key, g.Attributes[key]);
                }
                return graphicCopy;
            }
            return null;
        }

        public static string GetThisAssemblyDirectory()
        {
            return (new FileInfo(Assembly.GetAssembly(typeof(ArcServerClientHelper)).Location)).Directory.FullName;
        }
    }
}
